package com.seckill.demo.controller;


import com.seckill.demo.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
public class BussinessController {

    @Autowired
    private GoodsService goodsService;


    /**
     * 1000 个人 抢 100个商品，库存为0 抢占失败
     * @return
     */
    @RequestMapping("/take")
    public Object takeOrder(){
        return goodsService.deductionStore(1L, 1);
    }


}
